import request from '@/plugins/request'
import { IResponseData } from '@/types/request-base'
import { json2FormData } from '@/utils'

// 经销商解冻/冻结

/**
 * 经销商解冻/冻结详情
 * @param {string} ID
 */
export function detail(id: string) {
  return request<IResponseData>({
    method: 'get',
    url: `/app/v1/ctmCustomerChange/detail/freeze/${id}`,
    loading: true
  })
}

/**
 * 经销商解冻/冻结保存与提交
 */
export function saveOrSubmit(data: any) {
  return request<IResponseData>({
    method: 'post',
    url: `/app/v1/ctmCustomerChange/createOrSubmit/freeze`,
    data,
    loading: true
  })
}

/**
 * 查询指定经销商冻结和解冻账号范围
 */
export function queryFreezeRange(code: string) {
  return request<IResponseData>({
    method: 'get',
    url: `/app/v1/ctmCustomerFreezeRange/queryByCustomerCode/${code}`
    // loading: true
  })
}
